import { Injectable } from '@nestjs/common';
import { HomeBottomDao as Dao } from '@/servers/daos/home/home-bottom.dao';

@Injectable()
export class BottomService {

    constructor(private dao: Dao) { }


    /**
     * 查看灯杆有些设备
     * @param params 
     */
    getDeviceList(params: any) {
        let list = [
            {
                id: 1,
                name: '灯杆'
            },
            {
                id: 2,
                name: '网关'
            },
            {
                id: 3,
                name: '照明'
            },
            {
                id: 4,
                name: '监控'
            },
            {
                id: 5,
                name: '屏幕'
            },
            {
                id: 6,
                name: '充电'
            },
            {
                id: 7,
                name: '气象'
            },
            {
                id: 8,
                name: '广播'
            },
            {
                id: 9,
                name: '5G'
            },
            {
                id: 10,
                name: '报警'
            },
            {
                id: 11,
                name: '电源'
            }
        ];
        let data = [];
        list.forEach(item => {
            let num = Math.floor(Math.random() * 10);
            if (num > 5 || item.id == 1) {
                data.push(item);
            }
        });
        return data;

    }

    /**
    * 获取灯杆详情
    */
    getLamppostDetail(params: any) {
        return this.dao.getLamppostDetail(params);
    }


}
